package com.atguigu.gulimall.ware.service;

import com.atguigu.common.to.OrderTo;
import com.atguigu.common.to.StockLockedTo;
import com.atguigu.gulimall.ware.vo.OrderStockRequest;
import com.atguigu.gulimall.ware.vo.OrderVo;
import com.atguigu.gulimall.ware.vo.SkuHasStockVo;
import com.baomidou.mybatisplus.extension.service.IService;
import com.atguigu.common.utils.PageUtils;
import com.atguigu.gulimall.ware.entity.WareSkuEntity;

import java.util.List;
import java.util.Map;

/**
 * 商品库存
 *
 * @author durunwu
 * @email 172885308@qq.com
 * @date 2023-02-07 14:59:11
 */
public interface WareSkuService extends IService<WareSkuEntity> {

    PageUtils queryPage(Map<String, Object> params);

    void addStock(Long skuId, Long wareId, Integer skuNum) throws Exception;

    List<SkuHasStockVo> getSkuHasStock(List<Long> skuIds);

    boolean orderStock(OrderStockRequest orderStockRequest);

    void unlockStock(StockLockedTo lockedTo);

    void unlockStock(OrderTo orderTo);

}

